<!DOCTYPE html>
<html lang="en" ng-app="">
<head>
  <meta charset="UTF-8">
  <title>ng环境与js环境不互通</title>
  <script src="angular.js"></script>
</head>
<body ng-init="a=2">
    <input type="text" ng-model="a">
    <input type="button" value="输出" onclick="showmsg()">
    <script>
      function showmsg() {
        console.log(a);  //Uncaught ReferenceError: a is not defined
      }
    </script>
</body>
</html>